﻿using System;
using System.Runtime.Serialization;
using NCMIS.ObjectModel.MetaData;

namespace NCMIS.ObjectModel
{
    /// <summary>
    /// Represents a <see cref="NCMIS.Objectmodel.CmisObjectList"/> with ChangeToken.
    /// </summary>
    [DataContract(Namespace = CmisNs.Cmism)]
    public class TokenedCmisObjectList
    {
        /// <summary>
        /// List of CMIS objects.
        /// </summary>
        [DataMember(Name = "objects")]
        public CmisObjectList Objects
        {
            get;
            set;
        }

        /// <summary>
        /// Represents a "ChangeToken" used for optimistic locking and/or concurrency checking to ensure that user updates do not conflict.
        /// If a Repository provides values for the ChangeToken property for an Object, then all invocations of the "update" methods on
        /// that object must provide the value of the changeToken property as an input parameter, and the Repository must throw an
        /// updateConflictException if the value specified for the changeToken does not match the changeToken value for the object
        /// being updated.
        /// </summary>
        [DataMember(Name = "changeToken")]
        public string ChangeToken
        {
            get;
            set;
        }
    }
}
